﻿using MyShopCity.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MyShopCity.Controllers
{
    public class ShopCityController : Controller
    {
        private MyShopCity.DAL.ShopCity db = new DAL.ShopCity();

        //
        // GET: /ShopCity/
        public ActionResult Index()
        {
            return View(db.Commodities);
        }

        [NonAction]
        public ActionResult CreateCommodity() 
        {
            return View();
        }
        [HttpGet,ValidateInput(true)]
        public ActionResult CreateCommodity(Commodity comm) 
        {
            if (db.Commodities.Contains(comm))
            {
               System.Data.Entity.
            }
            else
            {

            }


            db.Commodities.Contains(comm);

            if (comm!=null)
            {
                db.Entry<Commodity>(comm).State = System.Data.Entity.EntityState.Modified;
            }
            return View(comm);
        }
	}
}